package com.jc.knights.impl2;

import com.jc.knights.Knight;
import com.jc.knights.Quest;

/**
 * 依赖注入--构造注入
 */
public class BraveKnight implements Knight {
    private Quest quest;

    public BraveKnight(Quest quest) {
        this.quest = quest;
    }

    @Override
    public void embarkOnQuest() {
        quest.embark();
    }
}
